package com.innovation.chengzhangriji.ui;

import android.content.Intent;
import android.graphics.Bitmap;

import com.google.zxing.Result;
import com.innovation.chengzhangriji.Config;
import com.umeng.analytics.MobclickAgent;

public class CaptureActivity extends com.google.zxing.client.android.CaptureActivity {

    @Override
    public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) {
        Intent intent = new Intent();
        intent.putExtra(Config.ACTION_EXTERNAL_RESULT_QRCDOE,rawResult.getText());
        setResult(RESULT_OK,intent);
        finish();
    }

    @Override
    protected void onResume() {
        super.onResume();
        MobclickAgent.onPageStart(Config.UMENG_PAGE_CAPTURE);
        MobclickAgent.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        MobclickAgent.onPageEnd(Config.UMENG_PAGE_CAPTURE);
        MobclickAgent.onResume(this);
    }
}

